﻿<Common:LayoutAwarePage
	x:Class="Coding4Fun.Toolkit.Test.WindowsStore.Samples.Color.ColorHexPicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Coding4Fun="using:Coding4Fun.Toolkit.Controls"
    xmlns:Common="using:Coding4Fun.Toolkit.Test.WindowsStore.Common">

	<Grid Style="{StaticResource LayoutRootStyle}">
		<Grid.RowDefinitions>
			<RowDefinition Height="140"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<Common:BaseHeader Title="Color Hexagon Picker" />
		<Grid Grid.Row="1" HorizontalAlignment="Stretch" MinHeight="500">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<StackPanel Grid.Column="0" Orientation="Vertical">
				<Slider Background="White"  BorderThickness="1" 
						Name="_colorBrightSteps"
                        HorizontalAlignment="Stretch" Margin="10, 0"
                        SmallChange="1"
						Value="4"
						Minimum="0"
						Maximum="6" />
				<TextBlock Text="color brightness steps" Margin="10, -20, 10, 0"/>
			</StackPanel>
			<StackPanel Grid.Column="1" Orientation="Vertical">
				<Slider 
						Name="_colorDarkSteps"
                        HorizontalAlignment="Stretch" Margin="10, 0"
						SmallChange="1"
						Value="2"
                        Minimum="0"
						Maximum="6"  Background="White"/>
				<TextBlock Text="color darkness steps" Margin="10, -20, 10, 0"/>
			</StackPanel>
			<StackPanel Grid.Row="1" Orientation="Vertical">
				<Slider
                Background="White"
						Name="_greySteps"
                        HorizontalAlignment="Stretch" Margin="10, 0"
						SmallChange="1"
						Value="20"
						Minimum="0"
						Maximum="25" />
				<TextBlock Text="grey steps"  Margin="10, -20, 10, 0"/>
			</StackPanel>
			<Button 
				Grid.Column="1"
				Grid.Row="1"
				Content="Set to Red" 
                HorizontalAlignment="Stretch"
				Click="Button_Click" 
				Margin="10" />
			<Coding4Fun:ColorHexagonPicker 
				x:Name="_myColorControl" 
				Grid.Row="2" Grid.ColumnSpan="2"
				Color="Blue"
				SelectedStrokeColor="White"
				ColorBrightnessSteps="{Binding ElementName=_colorBrightSteps, Path=Value}"
				ColorDarknessSteps="{Binding ElementName=_colorDarkSteps, Path=Value}"
				GreyScaleSteps="{Binding ElementName=_greySteps, Path=Value}"
				ColorChanged="ColorControl_ColorChanged" />
				
			<StackPanel Orientation="Horizontal" Grid.Row="3">
				<StackPanel Margin="12">
					<TextBlock>Via Binding:</TextBlock>
					<Rectangle 
                            Height="25"
                            Fill="{Binding ElementName=_myColorControl, Path=SolidColorBrush}" />
				</StackPanel>
				<StackPanel Margin="12">
					<TextBlock>Via Event:</TextBlock>
					<Rectangle 
                            Name="_colorFromEvent"
                            Height="25" />
				</StackPanel>
			</StackPanel>
		</Grid>
	</Grid>
</Common:LayoutAwarePage>